using NodeCanvas.Variables;

namespace NodeCanvas.Conditions
{
	[Name("Check Mecanim Int")]
	public class MecanimCheckInt : MecanimConditions
	{
		public enum ComparisonTypes
		{
			EqualTo = 0,
			GreaterThan = 1,
			LessThan = 2
		}

		[RequiredField]
		public string mecanimParameter;

		public ComparisonTypes comparison;

		public BBInt value;

		protected override string info
		{
			get
			{
				string text = "==";
				if (comparison == ComparisonTypes.GreaterThan)
				{
					text = ">";
				}
				if (comparison == ComparisonTypes.LessThan)
				{
					text = "<";
				}
				return "Mec.Int '" + mecanimParameter + "' " + text + " " + value;
			}
		}

		protected override bool OnCheck()
		{
			if (comparison == ComparisonTypes.GreaterThan)
			{
				return base.animator.GetInteger(mecanimParameter) > value.value;
			}
			if (comparison == ComparisonTypes.LessThan)
			{
				return base.animator.GetInteger(mecanimParameter) < value.value;
			}
			return base.animator.GetInteger(mecanimParameter) == value.value;
		}
	}
}
